
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>INDEX</title>
<?php
	/* We add some JavaScript to pages with the comment form
	 * to support sites with threaded comments (when in use).
	 */
	if ( is_singular() && get_option( 'thread_comments' ) )
		wp_enqueue_script( 'comment-reply' );

	/* Always have wp_head() just before the closing </head>
	 * tag of your theme, or you will break many plugins, which
	 * generally use this hook to add elements to <head> such
	 * as styles, scripts, and meta tags.
	 */
	wp_head();
?>

<style type="text/css" media="screen" >
	@import url("<?php bloginfo("stylesheet_url"); ?>");
</style>
<script type="text/javascript">
function check_login()
{
	alert ('You must login first');	
}
/***********************************************
* Tab Content script-  Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//Set tab to intially be selected when page loads:
//[which tab (1=first tab), ID of tab content to display]:
var initialtab=[1, "sc1"]

////////Stop editting////////////////

function cascadedstyle(el, cssproperty, csspropertyNS){
if (el.currentStyle)
return el.currentStyle[cssproperty]
else if (window.getComputedStyle){
var elstyle=window.getComputedStyle(el, "")
return elstyle.getPropertyValue(csspropertyNS)
}
}

var previoustab=""

function expandcontent(cid, aobject){
if (document.getElementById){
highlighttab(aobject)
detectSourceindex(aobject)
if (previoustab!="")
document.getElementById(previoustab).style.display="none"
document.getElementById(cid).style.display="block"
previoustab=cid
if (aobject.blur)
aobject.blur()
return false
}
else
return true
}

function highlighttab(aobject){
if (typeof tabobjlinks=="undefined")
collecttablinks()
for (i=0; i<tabobjlinks.length; i++)
tabobjlinks[i].style.backgroundColor=initTabcolor
var themecolor=aobject.getAttribute("theme")? aobject.getAttribute("theme") : initTabpostcolor
aobject.style.backgroundColor=document.getElementById("tabcontentcontainer").style.backgroundColor=themecolor
}

function collecttablinks(){
var tabobj=document.getElementById("tablist")
tabobjlinks=tabobj.getElementsByTagName("A")
}

function detectSourceindex(aobject){
for (i=0; i<tabobjlinks.length; i++){
if (aobject==tabobjlinks[i]){
tabsourceindex=i //source index of tab bar relative to other tabs
break
}
}
}

function do_onload(){
var cookiename=(typeof persisttype!="undefined" && persisttype=="sitewide")? "tabcontent" : window.location.pathname
var cookiecheck=window.get_cookie && get_cookie(cookiename).indexOf("|")!=-1
collecttablinks()
initTabcolor=cascadedstyle(tabobjlinks[1], "backgroundColor", "background-color")
initTabpostcolor=cascadedstyle(tabobjlinks[0], "backgroundColor", "background-color")
if (typeof enablepersistence!="undefined" && enablepersistence && cookiecheck){
var cookieparse=get_cookie(cookiename).split("|")
var whichtab=cookieparse[0]
var tabcontentid=cookieparse[1]
expandcontent(tabcontentid, tabobjlinks[whichtab])
}
else
expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1])
}

if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload
</script>
</head>

<body>
<div id="header-wrapper">
	<div id="header">
    	<div class="header-logo">
        	<h1>Question Mark</h1>
        </div>
        <div class="header-title">
        	<h3>An question/answers system powered<br /> 100% by WordPress.</h3>
        </div>
        
        <div class="userpanel">
        		<?php 	
				if($user_ID == 0)
					$user_ID = $_SESSION['user_id_yer'];				
				if($user_ID > 0) 				
				{	
					$profileuser = get_user_to_edit($user_ID);
				?>
                <div class="user-img">
        		<img src="<?php echo get_bloginfo('template_directory'); ?>/images/user-img.jpg" />
            	</div>
                <div class="user-title">                
				<h5>
				<?=$profileuser->first_name.' '.$profileuser->last_name?>
				</h5>
                <br /><br />
				<a href="#">Profile</a> <font style="float:right; color:#5f83a1;">|</font> <a href="<?php bloginfo('url'); ?>/?action=ulogout">Log Out</a>	
                </div>		        
				<?php
				} 
				?>   
        </div>
        
        <div style="clear:both;"></div>
    </div>
    <div class="menu-wrapper">
    	<div class="menu">
        	<p class="topics-title">TRENDING TOPICS:</p>
        	<div class="topics">
        	        <?php $query = "SELECT  t.term_id,t.name
FROM  wp_terms t JOIN wp_term_taxonomy tt ON t.term_id=tt.term_id
WHERE tt.taxonomy = 'category' AND t.term_id >1 and parent=0  "; 
        	        $results = $wpdb ->get_results($query);
        	        ?>   
<ul>
<?php $j=0; foreach ($results as $c){ $j++?>

<li><a href="<?php bloginfo('url');?>/?cat=<?php echo $c->term_id ;?>" ><?php echo $c->name;?></a></li>

<?php if($j==4){break;} };?>	
</ul>
            </div>
            <div class="all">
            	<ul id="nav2">

<li><a href="#">See all</a>
<ul class="children">
<?php wp_list_categories('orderby=name&title_li=');
$this_category = get_category($cat);
if (get_category_children($this_category->cat_ID) != "") {
echo "<ul>";
wp_list_categories('orderby=id&show_count=0&title_li=
&use_desc_for_title=1&child_of='.$this_category->cat_ID);
echo "</ul>";
}
?>
</ul>
</li>
</ul>
            </div>
            <div class="menu-right">
            	<ul>
                	<li><a href="#">About Us</a></li>
                    <li><a href="#">Contact</a></li>
                    <li><a href="#">Friends</a></li>
                    <li><a href="#">Other Pages</a></li>
                </ul>
            </div>
    	</div>
    </div>
</div>